package main

import (
	"encoding/json"
	"fmt"
)

func main() {
	resString := make([]string, 0)
	resString = append(resString, "one")
	resString = append(resString, "two")
	resString = append(resString, "three")
	resString = append(resString, "four")

	buffer, _ := json.Marshal(resString)
	fmt.Println(buffer)

	var desString []string
	if err := json.Unmarshal(buffer, &desString); err != nil {
		return
	}

	fmt.Println(resString, desString)

	for index, v := range desString {
		fmt.Println(index, v)
	}

	finalString := append(resString, desString...)
	fmt.Println(finalString)

	buffer = []byte("hello")
	fmt.Println(string(buffer[:0]))
	fmt.Println(string(buffer[:1]))
	var a string
	a = string(buffer[:1])
	fmt.Println(a)
}
